package com.code.day10.reflectss;

import java.io.InputStream;
import java.lang.reflect.Method;
import java.util.Properties;

public class TestReflect {
    public static void main(String[] args) throws Exception {
        Properties properties = new Properties();
        InputStream inputStream = TestReflect.class.getClassLoader().getResourceAsStream("reflect.properties");
        properties.load(inputStream);
        String className = properties.getProperty("className");
        Class <?> class1 = Class.forName(className);
        Object o = class1.newInstance();

        String methodName = properties.getProperty("methodName");
        Method method = class1.getMethod(methodName);
        method.invoke(o);
        inputStream.close();
    }
}
